//下载相关实体

export class DownloadProgress {
    total: number;//总大小
    current: number;//当前大小
    status: number;//状态，0-下载中，1-下载完成，2-下载失败
    progressPercentage: number;//当前大小
    headers: Map<string, string>;//请求头

    constructor(total: number, current: number, headers: Map<string, string>, progressPercentage: number, status: number) {
        this.total = total;
        this.current = current;
        this.headers = headers;
        this.progressPercentage = progressPercentage;
        this.status = status;
    }

    // 计算进度的方法
    // getProgress(): number {
    //     if (this.total === Number(0)) {
    //         return 0; // 避免除以零的情况
    //     }
    //     return Number((this.current / this.total)) * 100;
    // }
}